<?php
require_once ("../../src/db/connectdatabase.php");
require_once ("../../src/entitys/Admin.php");

/**
check login table admin
*/
function checkLoginAdmin($admin) {
	$con = new ConnectDB();
	
	$tbl = "tcadminbankdn";
	$fn = array('admintcuser');
	$condetion = array('admintcuser' => ($admin->getUser()), 'passtcadmin' => ($admin->getPass()));
	$result = $con -> getvalue($tbl, $fn, $condetion);
	if(sizeof($result) != 0) {
		return true;
	}
	return false;
}

/**
update password admin
*/
function updateAdmin($admin) {
	$con = new ConnectDB();
	
	$tbl = "tcadminbankdn";
	$fn = array('passtcadmin' => ($admin -> getPass()));
	$condition = array('admintcuser' => ($admin -> getUser()));
	return $con -> update($tbl, $fn, $condition);
}
?>